# README

This the replication package for the paper "Technology Adoption and Productivity Growth: Evidence from Industrialization in France." It has been deposited in JPE's dataverse at https://dataverse.harvard.edu/dataverse/JPE.

In order to replicate all the results of the paper you need the software Stata.

In this readme file, we will: i) present the structure of the folder; ii) describe the instructions for running the code and all the files present in the replication folder; iii) provide some additional documentation.

## Structure of the folder
The structure of the folder is as follows:

```
.
└── code   
    |
    └── 1_analysis
    |   ├── 1_regressions_metal.do
    |   ├── 2_regressions_cotton.do
    |   ├── 3_regressions_paper.do
    |   ├── 4_mechanism_cotton_building_layout.do
    |   ├── 5_spatial_regressions.do
    |   ├── 6_survival_rate_metal_paper_cotton.do  
    |
    └── 1_master_analysis.do          
    |
    └── 2_appendix
    |   └── 1_metallurgy
    |   |   ├── regressions_metal_app.do 
    |   └── 2_cotton
    |   |   ├──  regressions_metal_app.do              
    |   └── 3_paper
    |   |   ├── regressions_paper_app.do
    |   └── 4_mechanism
    |   |   ├── 1_mechanism_cotton_building_layout_app.do                             
    |   |   ├── 2_mechanism_strikes_app.do                             
    |   |   ├── 3_mechanism_encyclopedie_app.do                             
    |   └── 5_spatial
    |   |   ├── spatial_regressions_app.do                              
    |   └── 6_misc
    |   |   ├── misc_figures.do  
    |
    └── 2_master_appendix.do 
    └── 3_model_simulation
    |   └── simulate_model.do                           
        
└── data
    ├── british_yarn_prices.xlsx
    ├── cotton_building_layout.dta
    ├── encyclopedie_plates.dta
    ├── panel_cotton.dta
    ├── panel_metallurgy.dta
    ├── panel_paper.dta
    ├── strikes.dta


└── outputs
    └── appendix
    |   └── Figures
    |   └── Tables
    └── main_paper
    |   └── Figures
    |   └── Tables

└── tech_adoption.do		        
```		    
		    
## Instructions for running the code	and description of the files 

In order to replicate the results, it is sufficient to set the replication folder as the Stata directory using the syntax in line 22 of the dofile <strong>`tech_adoption.do`</strong>. 

`tech_adoption.do` calls the do-files `1_master_analysis.do`, `2_master_appendix.do` and `simulate_model.do` in the `code` folder, which performs the entire analysis. Path names do not need to be changed in any other do-file. 

**************

The <strong>`code`</strong> folder contains the code necessary for replication. It is divided in three main sections; one replicates the empirical analysis from the main paper; another replicates the empirical analysis in the appendix; and the third replicates the model simulation.  

The folder is structured as follows:

 * `1_master_analysis.do` Runs everything inside the directory `1_analysis`. 
 * `1_analysis` Contains all do-files which replicate the empirical analysis  in the main paper.
 * `2_master_appendix.do` Runs everything inside the directory `2_appendix`. 
 * `2_appendix` Contains all do-files which replicate the empirical analysis  in the appendix.
 * `3_model_simulation` Contains the do-file which replicates the model simulation. 

Below we briefly describe each dofile in the <strong>`1_analysis`</strong>, <strong>`2_appendix`</strong> and <strong>`3_model_simulation`</strong> directories.

The <strong>`1_analysis `</strong> folder contains:

 * <strong>`1_regressions_metal.do`</strong>: It runs regressions (except for the spatial regressions) and generates figures and tables shown in the main paper for the metallurgy sector.  It uses data from `panel_metallurgy.dta.` It generates Figures 1 (Panel B), 2 (Panel B) and Table 1 (Panel B).
 * <strong>`2_regressions_cotton.do`</strong>: It runs regressions (except for the spatial regressions) and generates figures and tables shown in the main paper for the cotton spinning sector. It uses data from `panel_cotton.dta`. It generates Figures 1 (Panel A), 2 (Panel A) and Tables 1 (Panel A), 3.
 * <strong>`3_regressions_paper.do`</strong>: It runs regressions (except for the spatial regressions) and generates figures and tables shown in the main paper for the paper milling sector. It generates Figures 1 (Panel C), 2 (Panel C) and Table 1 (Panel C).
 * <strong>`4_mechanism_cotton_building_layout.do`</strong>: It generates the figures shown in the main paper analyzing the building layout of cotton spinning firms. It uses data from `cotton_building_layout.dta`. It generates Figure 4.
 * <strong>`5_spatial_regressions.do`</strong>: It runs all  spatial regressions and generates the corresponding figures  shown in the main paper for the three sectors. It uses data from `panel_metallurgy.dta`,  `panel_cotton.dta`, and `panel_paper.dta`. It generates Figure 5.
 * <strong>`6_survival_rate_metal_paper_cotton.do`</strong>: It computes the survival rates shown in the main paper for the three sectors. It uses data from `panel_metallurgy.dta`,  `panel_cotton.dta`, and `panel_paper.dta`. It generates Table 2.

The <strong>`2_appendix`</strong> folder contains:

 * <strong>`1_metallurgy/regressions_metal_app.do`</strong>: It runs regressions (except for the spatial regressions) and generates figures and tables shown in the appendix for the metallurgy sector. It uses data from `panel_metallurgy.dta`. It generates Tables A.3, A.6, A.18 (column 2), A.20, A.21, A.22 (Panel B), A.25 (columns 2, 5), A.26 (column 2), A.27 (Panel B), A.29 (Panel B)
 * <strong>`2_cotton/regressions_cotton_app.do`</strong>: It runs regressions (except for the spatial regressions) and generates figures and tables shown in the appendix for the cotton spinning sector. It uses data from `panel_cotton.dta`. It generates Figure A.19 and Tables A.2, A.5, A.17, A.18 (column 1), A.19, A.22 (Panel A), A.23, A.24, A.25 (columns 1, 4), A.26 (column 1), A.27 (Panel A), A.28, A.29 (Panel A), A.30, A.31
 * <strong>`3_paper/regressions_paper_app.do`</strong>: It runs regressions (except for the spatial regressions) and generates figures and tables shown in the appendix for the paper milling sector. It uses data from `panel_paper.dta`. It generates Tables A.4, A.7, A.18 (column 3), A.22 (Panel C), A.25 (columns 3, 6), A.26 (column 3), A.27 (Panel C), A.29 (Panel C).
 * <strong>`4_mechanism/1_mechanism_cotton_building_layout_app.do`</strong>: It runs regressions and generates the corresponding table shown in the appendix regarding the building layout of cotton spinning firms. It uses data from `cotton_building_layout.dta`. It generates Table A.8.
 * <strong>`4_mechanism/2_mechanism_strikes_app.do`</strong>: It runs regressions and generates the corresponding table shown in the appendix regarding strikes for the three sectors. It uses data from `strikes.dta`. It generates Table A.9.
 * <strong>`4_mechanism/3_mechanism_encyclopedie_app.do`</strong>: It generates the Figure shown in the appendix regarding the Encyclopédie plates. It uses data from `encyclopedie_plates.dta`. It generates Figure A.9.
 * <strong>`5_spatial/spatial_regressions_app.do`</strong>: It runs all spatial regressions and generates the corresponding  tables shown in the appendix for the three sectors. It uses data from `panel_metallurgy.dta`, `panel_cotton.dta`, and `panel_paper.dta`. It generates Tables A.10, A.11, A.12, A.13, A.14, A.15, A.16.
 * <strong>`6_misc/misc_figures.do`</strong>: It generates the figure regarding the evolution of British yarn prices shown in the appendix. It uses data from `british_yarn_prices.xlsx`. It generates Figure A.3.

 The <strong>`3_model_simulation`</strong> folder contains:
 
 *  <strong>`simulate_model.do`</strong>: It generates Figures 3,  A.15 (Panels A and B) and A.16. 
 


**************

The <strong>`data`</strong> directory contains all datasets used in the replication. It is structured as follows:

 * <strong>`panel_cotton.dta`</strong>: Panel dataset on cotton spinning firms.
 * <strong>`panel_metallurgy.dta`</strong>: Panel dataset on metallurgy firms.
 * <strong>`panel_paper.dta`</strong>: Panel dataset on paper milling firms.
 * <strong>`cotton_building_layout.dta`</strong>: Dataset on building layout for cotton spinning firms.
 * <strong>`encyclopedie_plates.dta`</strong>: Dataset on Encyclopédie plates.
 * <strong>`strikes.dta`</strong>: Dataset on strikes events, occurring in the textile, metallurgy, and paper milling sectors.
 * <strong>`british_yarn_prices.xlsx`</strong>: Dataset on prices of British yarn.

**************

The <strong>`outputs`</strong> directory is where all tables and figures created in the replication will be outputed to. Tables are outputed in tex format, figures are outputed as pdf and eps. It is purposefully empty.



## iii) Further documentation

Below we list all figures and tables shown in the main paper and  in the appendix, specifying the dofile that generates each of them where relevant.

 * <strong>FIGURES -- Main paper</strong>

``` 
- Figure 1 (Panel A): code/1_analysis/2_regressions_cotton.do 
- Figure 1 (Panel B): code/1_analysis/1_regressions_metal.do
- Figure 1 (Panel C): code/1_analysis/3_regressions_paper.do
- Figure 2 (Panel A): code/1_analysis/2_regressions_cotton.do
- Figure 2 (Panel B): code/1_analysis/1_regressions_metal.do
- Figure 2 (Panel C): code/1_analysis/3_regressions_paper.do
- Figure 3: code/3_model_simulation/simulate_model.do
- Figure 4 (Panels A and B): 
			 code/1_analysis/4_mechanism_cotton_building_layout    
- Figure 5 (Panels A, B, and C): code/1_analysis/5_spatial_regressions    	
``` 

 * <strong>TABLES -- Main paper</strong>

``` 
- Table 1 (Panel A): code/1_analysis/2_regressions_cotton.do 
- Table 1 (Panel B): code/1_analysis/1_regressions_metal.do
- Table 1 (Panel C): code/1_analysis/3_regressions_paper.do
- Table 2: code/1_analysis/6_survival_rate_metal_paper_cotton.do
- Table 3: code/1_analysis/2_regressions_cotton.do	
``` 


 * <strong>FIGURES -- Appendix </strong>

``` 
- Figure A1: not part of replication.  
- Figure A2: not part of replication 
- Figure A3: code/2_appendix/6_misc/misc_figures.do
- Figure A4: not part of replication      
- Figure A5: not part of replication 
- Figure A6: not part of replication 
- Figure A7: not part of replication
- Figure A8: not part of replication
- Figure A9: code/2_appendix/4_mechanism/3_mechanism_encyclopedie_app
- Figure A10: not part of replication 
        – underlying data is from  Walker Hanlon.  
- Figure A11: not part of replication
- Figure A12: not part of replication
- Figure A13: not part of replication
- Figure A14: not part of replication 
        - underlying data is from panel_cotton.dta, panel_metallurgy.dta
          and panel_paper.dta.
- Figure A15 (Panel A and B): code/3_model_simulation/simulate_model.do
- Figure A16: code/3_model_simulation/simulate_model.do
- Figure A17: not part of replication 
        - underlying data is from panel_cotton.dta, panel_metallurgy.dta
          and panel_paper.dta.
- Figure A18: not part of replication 
        – underlying data is from Guillaume Daudin.
- Figure A19: code/2_appendix/2_cotton/regressions_cotton_app.do
``` 

 * <strong>TABLES -- Appendix </strong>
		    	
```    	
- Table A.1: not part of repliaction 
    – underlying data is from  Walker Hanlon.  
- Table A.2: code/2_appendix/2_cotton/regressions_cotton_app.do
- Table A.3: code/2_appendix/1_metallurgy/regressions_metal_app.do
- Table A.4: code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.5: code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.6: code/2_appendix/1_metallurgy/regressions_metal_app.do 
- Table A.7: code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.8: 
    code/2_appendix/4_mechanism/1_mechanism_cotton_building_layout_app.do
- Table A.9: code/2_appendix/4_mechanism/2_mechanism_strikes_app.do
- Table A.10: code/2_appendix/5_spatial/spatial_regressions_app.do
- Table A.11: code/2_appendix/5_spatial/spatial_regressions_app.do
- Table A.12: code/2_appendix/5_spatial/spatial_regressions_app.do 
- Table A.13: code/2_appendix/5_spatial/spatial_regressions_app.do
- Table A.14: code/2_appendix/5_spatial/spatial_regressions_app.do
- Table A.15: code/2_appendix/5_spatial/spatial_regressions_app.do
- Table A.16: code/2_appendix/5_spatial/spatial_regressions_app.do
- Table A.17: code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.18 (Column 1): 
        code/2_appendix/2_cotton/regressions_cotton_app.do
- Table A.18 (Column 2): 
        code/2_appendix/1_metallurgy/regressions_metal_app.do
- Table A.18 (Column 3): 
        code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.19: code/2_appendix/2_cotton/regressions_cotton_app.do
- Table A.20: code/2_appendix/1_metallurgy/regressions_metal_app.do
- Table A.21: code/2_appendix/1_metallurgy/regressions_metal_app.do
- Table A.22 (Panel A): 
        code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.22 (Panel B): 
        code/2_appendix/1_metallurgy/regressions_metal_app.do 
- Table A.22 (Panel C): 
        code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.23: code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.24 (Panel A): code/2_appendix/2_cotton/regressions_cotton_app.do
- Table A.25 (Columns 1, 4): 
        code/2_appendix/2_cotton/regressions_cotton_app.do
- Table A.25 (Columns 2, 5): 
        code/2_appendix/1_metallurgy/regressions_metal_app.do 
- Table A.25 (Columns 3, 6): 
        code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.26 (Column 1): 
        code/2_appendix/2_cotton/regressions_cotton_app.do
- Table A.26 (Column 2): 
        code/2_appendix/1_metallurgy/regressions_metal_app.do 
- Table A.26 (Column 3): 
        code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.27 (Panel A): 
        code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.27 (Panel B): 
        code/2_appendix/1_metallurgy/regressions_metal_app.do 
- Table A.27 (Panel C): 
        code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.28: code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.29 (Panel A): 
        code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.29 (Panel B): 
        code/2_appendix/1_metallurgy/regressions_metal_app.do 
- Table A.29 (Panel C): code/2_appendix/3_paper/regressions_paper_app.do 
- Table A.30: code/2_appendix/2_cotton/regressions_cotton_app.do 
- Table A.31: code/2_appendix/2_cotton/regressions_cotton_app.do 
```	
